home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / exec / RCS / execl.c,v < prev    next >
Encoding:
Text File  |  1992-06-09  |  3.3 KB  |  183 lines

  1. head     1.4;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.4.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.4
  10. date     88.07.28.17.41.41;  author ouster;  state Exp;
  11. branches 1.4.1.1;
  12. next     1.3;
  13.  
  14. 1.3
  15. date     88.07.25.10.49.49;  author ouster;  state Exp;
  16. branches ;
  17. next     1.2;
  18.  
  19. 1.2
  20. date     88.07.11.15.40.31;  author ouster;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     88.06.19.16.55.57;  author ouster;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29. 1.4.1.1
  30. date     92.06.08.22.52.30;  author kupfer;  state Exp;
  31. branches ;
  32. next     ;
  33.  
  34.  
  35. desc
  36. @@
  37.  
  38.  
  39. 1.4
  40. log
  41. @Add #ifdefs to generate correct lint library.
  42. @
  43. text
  44. @/* 
  45.  * execl.c --
  46.  *
  47.  *    Source code for the execl library procedure.
  48.  *
  49.  * Copyright 1988 Regents of the University of California
  50.  * Permission to use, copy, modify, and distribute this
  51.  * software and its documentation for any purpose and without
  52.  * fee is hereby granted, provided that the above copyright
  53.  * notice appear in all copies.  The University of California
  54.  * makes no representations about the suitability of this
  55.  * software for any purpose.  It is provided "as is" without
  56.  * express or implied warranty.
  57.  */
  58.  
  59. #ifndef lint
  60. static char rcsid[] = "$Header: execl.c,v 1.3 88/07/25 10:49:49 ouster Exp $ SPRITE (Berkeley)";
  61. #endif not lint
  62.  
  63. #include <stdlib.h>
  64. #include <varargs.h>
  65.  
  66. /*
  67.  * Library imports:
  68.  */
  69.  
  70. extern char **environ;
  71. extern execve();
  72. extern char **_ExecArgs();
  73.  
  74.  
  75. /*
  76.  *----------------------------------------------------------------------
  77.  *
  78.  * execl --
  79.  *
  80.  *    Execute a process, using the current environment variable,
  81.  *    instead of an explicitly-supplied one, and with arguments
  82.  *    in-line instead of in a separate array.
  83.  *
  84.  * Results:
  85.  *    This procedure returns only if the exec fails.  In this case
  86.  *    the return value is -1.
  87.  *
  88.  * Side effects:
  89.  *    Overlays the current process with a new image.  See the man
  90.  *    page for details.
  91.  *
  92.  *----------------------------------------------------------------------
  93.  */
  94.  
  95. #ifndef lint
  96. int
  97. execl(va_alist)
  98.     va_dcl            /* Name of file containing program to exec,
  99.                  * followed by one or more arguments of type
  100.                  * "char *", terminated by a zero argument. */
  101. {
  102.     char **argv;
  103.     char *name;
  104.     va_list args;
  105.  
  106.     va_start(args);
  107.     name = va_arg(args, char *);
  108.     argv = _ExecArgs(&args);
  109.     execve(name, argv, environ);
  110.     free((char *) argv);
  111.     return -1;
  112. }
  113. #else
  114. /* VARARGS2 */
  115. /* ARGSUSED */
  116. int
  117. execl(file, arg1)
  118.     char *file;
  119.     char *arg1;
  120. {
  121.     return 0;
  122. }
  123. #endif
  124. @
  125.  
  126.  
  127. 1.4.1.1
  128. log
  129. @Initial branch for Sprite server.
  130. @
  131. text
  132. @d17 1
  133. a17 1
  134. static char rcsid[] = "$Header: /sprite/src/lib/c/exec/RCS/execl.c,v 1.4 88/07/28 17:41:41 ouster Exp $ SPRITE (Berkeley)";
  135. @
  136.  
  137.  
  138. 1.3
  139. log
  140. @Lint.
  141. @
  142. text
  143. @d17 1
  144. a17 1
  145. static char rcsid[] = "$Header: execl.c,v 1.2 88/07/11 15:40:31 ouster Exp $ SPRITE (Berkeley)";
  146. d52 1
  147. a52 1
  148.     /* VARARGS0 */
  149. d70 11
  150. @
  151.  
  152.  
  153. 1.2
  154. log
  155. @When using varargs, only have a single argument in the list.
  156. @
  157. text
  158. @d17 1
  159. a17 1
  160. static char rcsid[] = "$Header: execl.c,v 1.1 88/06/19 16:55:57 ouster Exp $ SPRITE (Berkeley)";
  161. d20 1
  162. @
  163.  
  164.  
  165. 1.1
  166. log
  167. @Initial revision
  168. @
  169. text
  170. @d17 1
  171. a17 1
  172. static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
  173. d51 1
  174. d53 4
  175. a56 4
  176. execl(name, va_alist)
  177.     char *name;            /* Name of file containing program to exec. */
  178.     va_dcl            /* One or more arguments of type "char *",
  179.                  * terminated by a zero argument. */
  180. d59 1
  181. d63 1
  182. @
  183.